In [ ]:
# + = addition
# - = subtraction
# * = Multiplication
# ** = Exponentiation
# / = division
# // = floor division (quotient in division)
# % = modulo (remainder in division)
# When completed the program below will tell you the month and day of the first sunday after the first full moon of spring.
# You enter the year and the program will do the rest
# After each instruction below put in the proper command or commands.
In [6]:
#1. Let y be the inputted year (such as 1800 or 2023 or whatever you put in there.).
y = int(input("Enter a Year:"))
#2. Divide y by 19 and call the remainder a. Ignore the quotient.
a = y % 19
#3. Divide y by 100 to get a quotient b and a remainder c.
b = y // 100
c = y % 100
#4. Divide b by 4 to get a quotient d and a remainder e
d = b // 4
e = b % 4
#5. Divide 8 times b + 13 by 25 to get a quotient g. Ignore the remainder.
g = (8 * b + 13) // 25
#6. Divide 19 a + b-d-g + 15 by 30 to get a remainder h. Ignore the quotient.
h = (19 * a + b - d - g + 15) % 30
#7. Divide c by 4 to get a quotient j and a remainder k.
j = c // 4
k = c % 4
#8. Divide a + 11 h by 319 to get a quotient m. Ignore the remainder.
m = (a + 11 * h) // 319
#9. Divide 2 e + 2*j-k-h + m + 32 by 7 to get a remainder r. Ignore the quotient.
r = (2 * e + 2 * j - k - h + m + 32) % 7
#10. Divide h-m+r+ 90 by 25 to get a quotient n. Ignore the remainder.
n = (h - m + r + 90) // 25
#11. Divide h-m+r+n + 19 by 32 to get a remainder p. Ignore the quotient.
p = (h - m + r + n + 19) % 32
#12. Create a list with the months that will be printed
print("3.March")
print("4.April")
print("5.May")
#13. Take the n variable, and subtract 3 so as to choose the month in the list
(n - 3)
#14. print out a formated print statement with placeholders for the variable y, actualMonth, and p
print("Easter Day falls on th day ", p, "of the month ", n);
Enter a Year:2023 3.March 4.April 5.May Easter Day falls on th day 9 of the month 4
In [ ]: